<include file="./admin/Tpl/Public/_header.html" />
<script type="text/javascript">	
	$(function() {		
    /********角色列表START*********/
    $("#remove_right").click(function() {
        $('#brand_goods_cat_l option:selected').each(function() {
            if ($("#brand_goods_cat option:contains('" + $(this).text() + "')").length < 1) {
                $('#brand_goods_cat').append("<option value='" + $(this).val() + "'>" + $(this).text() + "</option>");

            }
        });
        $('#brand_goods_cat_l option:selected').each(function() {
            $(this).attr('selected', false);
        });
    });

    $("#remove_left").click(function() {
        $("#brand_goods_cat option:selected").remove();
    });
    /********角色列表END*********/
$("#form").submit(function(){

  

    if($.trim($("input[name='app_name']").val() ) == ''){
	    				ui.error('请输入菜单名');
						return false ;
	}
    if($("#brand_goods_cat option").length == 0){
	    				ui.error('请选择角色');
						return false ;    	
    }

	$("#brand_goods_cat option").attr("selected","selected");	

});	
		
	});
	</script>
<div class="so_main">
  <!-------- 添加/编辑表情 -------->
  <div id="editTpl_div">
  	<div class="page_tit">添加菜单</div>
	
	<div class="form2">
	
<form method="post" action="AppAdd" id="form">    
    <dl class="lineD">
      <dt>菜单名：</dt>
      <dd>
        <input name="app_name" type="text" value=""> *
	  </dd>
    </dl>
    
	  
	  
	  <dl class="lineD">
      <dt>分类：</dt>
      <dd>
	 <select name="app_fid" id="app_fid"><option value="0">顶级菜单</option>
	 
	  <volist name="applist" id="data">
                            <option   value="{$data.app_id}">{$data.app_name}</option>
              </volist>  
	 </select>  
      <select name="app_fid" id="app_fid2" >
	  <volist name="applist" id="data">

      <optgroup label="{$data.app_name}">
	  <volist name="data.items" id="i">
      <option value ="{$i.app_id}" style="text-align:left;">{$i.app_name}</option>
	  </volist>
      </optgroup>
	  
	  </volist>
	  </select>
	  </dd> 
      </dl>
	    <dl class="lineD">
      <dt>类型：</dt>
      <dd>
	 <input class="app1" name="type" checked="checked" type="radio" value="1" /> 菜单<input class="app2" name="type" type="radio" value="2" />应用 
	  </dd> 
      </dl>
      
      <dl class="lineD">
      <dt>角色选择：</dt>
      <dd style="height:110px;">
      <div style="position:relative;  margin:0; padding:0;">
	  <div style="float:left;">
            <select style="width:150px;" id="brand_goods_cat_l" name="epb_goods_cat_l" size="6" multiple="multiple">
                              <volist name="list" id="data">
                            <option   value="{$data.id}">{$data.name}&nbsp;({$data.alias})</option>
                            </volist>                        
               </select></div>
              
              
            <div style="float:left"><br/><input id="remove_right" name="remove_right" type="button" value="  &gt;  "> <br> <input id="remove_left" name="remove_left" type="button" value="  &lt;  ">
            </div>
            <div style="float:left;">
<select id="brand_goods_cat" name="rolelist[]" size="6" style="width:150px;" multiple="multiple"></select>
</div>
            </div>
            
            
	  </dd> 
 
 
      </dl>
	
	<dl class="lineD appurl" id="app_url" style=" display:none;" >
      <dt>路径：</dt>
      <dd>
	  <input name="app_url" type="text" value=""> *       
	  </dd> 
      </dl>
   
	
    <div class="page_btm">
      <input type="submit" class="btn_b"  name="add" value="确定" />
    </div>
	</form>
  </div>
  </div>
</div>
<div id="fid">
<option value="0">顶级菜单</option><volist name="applist" id="data">
                            <option   value="{$data.app_id}">{$data.app_name}</option>
              </volist>  
			  
			  </div>	 
<div  id="fid2">

<volist name="applist" id="data">

      <optgroup label="{$data.app_name}">
	  <volist name="data.items" id="i">
      <option value ="{$i.app_id}" style="text-align:left;">{$i.app_name}</option>
	  </volist>
      </optgroup>
	  
	  </volist>
	  
	  </div> 

<include file="./admin/Tpl/Public/_footer.html" />